home *** CD-ROM | disk | FTP | other *** search
/ Freelog 22 / freelog 22.iso / Prog / Djgpp / GPC2952B.ZIP / doc / gpc / docdemos / preddemo.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2001-02-09  |  446 b   |  23 lines

  1. program PredDemo;
  2.  
  3. type
  4.   Metasyntactical = (foo, bar, baz);
  5.  
  6. var
  7.   m: Metasyntactical;
  8.   c: Char;
  9.   a: array [1 .. 7] of Integer;
  10.   p: ^Integer;
  11.  
  12. begin
  13.   m := Pred (bar);     { foo }
  14.   c := Pred ('Z', 2);  { 'X' }
  15.   a [1] := 42;
  16.   a [4] := Pred (a [1]);     { 41 }
  17.   a [5] := Pred (a [4], 3);  { 38 }
  18.   {$X+}
  19.   p := @a [5];
  20.   p := Pred (p);     { now p points to a [4] }
  21.   p := Pred (p, 3);  { now p points to a [1] }
  22. end.
  23.